package com.ogilvy.audi.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Repository;

import com.ogilvy.audi.bean.Album;
import com.ogilvy.audi.dao.AlbumDao;
import com.ogilvy.frame.hibernate.BaseDaoImpl;
import com.ogilvy.frame.page.PageTools;
@Repository
public class AlbumDaoImpl extends BaseDaoImpl<Album> implements AlbumDao{
	public List<Album> selectAll(int pageNo, int pageSize,Map<String,Object> condition){
		System.out.println("相册查询");
		StringBuffer hql = new StringBuffer("from Album a join a.circle c where 1=1");
		if(condition.get("circleId")!=null){
			hql.append(" and c.circleId =").append(condition.get("circleId"));
		}
		System.out.println("输出hql:"+hql);
		return this.getSession().createQuery(hql.toString()).list();
		
		
	}
	public List<Album> selectAll(Map<String,Object> condition){
		return null;
	}

}
